<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
<input type="button" id="export" value="保存"/>
	<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
	<script type="text/javascript" src='js/FileSaver.js'></script>
	<script>
		 // var button = document.getElementById("export");
		 // button.addEventListener("click", saveHandler, false);
		 $('#export').on('click',function(){
		 	saveHandler();
		 })
		 function saveHandler(){
		      var data = {
		          name:"hanmeimei",
		          age:88
		      }
		      var content = JSON.stringify(data);
		      var blob = new Blob([content], {type: "text/plain;charset=utf-8"});
		      saveAs(blob, "save.json");
		 }
	</script>
</body>
</html>